package com.laoluo.erp.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.laoluo.erp.dao.TradeDAO;
import com.laoluo.erp.domain.Trade;
import com.laoluo.erp.service.TradeService;
import com.laoluo.erp.util.PageListData;

@Service
public class TradeServiceImpl implements TradeService {

	private TradeDAO dao;
	
	@Resource(name="tradeDAOImpl")
	public void setDao(TradeDAO dao){
		this.dao = dao;
	}
	
	public void save(Trade trade) {
		dao.save(trade);
	}

	public void delete(Trade trade) {
		dao.delete(trade);
	}

	public void delete(Integer id) {
		dao.delete(Trade.class,id);
	}

	public void update(Trade trade) {
		dao.update(trade);
	}

	public Trade findById(Integer id) {
		return dao.findById(Trade.class, id);
	}

	public List<Trade> findAll() {
		return dao.findAll(Trade.class);
	}
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public PageListData queryPage(Map param, int start, int limit,int page)
	{
		param.put("start", start);
		param.put("limit", limit);
		return dao.queryPage(Trade.class, param, start, limit,page);
	}

}
